package com.cfpl.admin_service.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cfpl.admin_service.VO.AvailableFertilizer;
import com.cfpl.admin_service.VO.FertilizationDetails;
import com.cfpl.admin_service.service.FertilizerAcquireRecordService;
import com.cfpl.project_common.pojo.FertilizerAcquireRecord;
import com.cfpl.admin_service.mapper.FertilizerAcquireRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 14720
* @description 针对表【fertilizer_acquire_record(肥料领取记录表)】的数据库操作Service实现
* @createDate 2023-10-17 14:29:56
*/
@Service
public class FertilizerAcquireRecordServiceImpl extends ServiceImpl<FertilizerAcquireRecordMapper, FertilizerAcquireRecord>
    implements FertilizerAcquireRecordService {

    @Autowired
    private FertilizerAcquireRecordMapper fertilizerAcquireRecordMapper;

    /**
     * 根据肥料领取记录查询本次所有的施肥记录
     * @param id 肥料领取记录
     * @return 本次所有的施肥记录
     */
    @Override
    public List<FertilizationDetails> queryUsageRecordByAcquireRecord(Long id) {
        return fertilizerAcquireRecordMapper.queryUsageRecordByAcquireRecord(id);
    }

    /**
     * 查询当前培育人员可使用的肥料信息列表
     * @param adminId 培育人员编号
     * @return 可使用的肥料信息列表
     */
    @Override
    public List<AvailableFertilizer> queryAvailableFertilizerList(Long adminId) {
        return fertilizerAcquireRecordMapper.queryAvailableFertilizerList(adminId);
    }
}




